package com.giscloud.amp.entity.vo;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.giscloud.amp.entity.AmpStaff;

import java.util.List;

/**
 * @Author:gxd
 * @Description:
 * @Date: 10:43 2018/2/24
 * @Modified By:
 */
public class AmpStaffVO extends AmpStaff {
    private String createdDtDesc;
    private String statusCdDesc;
    private String expDtDesc;
    private String staffExpDtDesc;
    private Integer quato;  //配额
    private Integer account; //账户余额
    private String relId;

    public Integer getQuato() {
        return quato;
    }

    public void setQuato(Integer quato) {
        this.quato = quato;
    }

    public Integer getAccount() {
        return account;
    }

    public void setAccount(Integer account) {
        this.account = account;
    }

    private List<String> rolesId;

    public void setCreatedDtDesc(String createdDtDesc) {
        this.createdDtDesc = createdDtDesc;
    }

    public String getExpDtDesc() {
        if(super.getExpDt() != null){
            return DateUtil.format(super.getExpDt(), DatePattern.NORM_DATETIME_FORMAT);
        }
        return "";
    }

    public void setExpDtDesc(String expDtDesc) {
        this.expDtDesc = expDtDesc;
    }

    public String getStaffExpDtDesc() {
        if(super.getStaffExpDt() != null){
            return DateUtil.format(super.getStaffExpDt(), DatePattern.NORM_DATETIME_FORMAT);
        }
        return "";
    }

    public void setStaffExpDtDesc(String staffExpDtDesc) {
        this.staffExpDtDesc = staffExpDtDesc;
    }

    public String getCreatedDtDesc() {
        if(super.getCreatedDt() != null){
            return DateUtil.format(super.getCreatedDt(), DatePattern.NORM_DATETIME_FORMAT);
        }
        return "";
    }

    public List<String> getRolesId() {
        return rolesId;
    }

    public void setRolesId(List<String> rolesId) {
        this.rolesId = rolesId;
    }

    public String getStatusCdDesc() {
        //用户状态 1|在用;2|删除;3|离职;4|冻结
        if (getStatusCd().equals(1L)) {
            return "在用";
        } else if (getStatusCd().equals(2L)) {
            return "删除";
        } else if (getStatusCd().equals(3L)) {
            return "离职";
        } else if (getStatusCd().equals(4L)) {
            return "冻结";
        } else {
            return "未知";
        }
    }

    public void setStatusCdDesc(String statusCdDesc) {
        this.statusCdDesc = statusCdDesc;
    }

    public String getRelId() {
        return relId;
    }

    public void setRelId(String relId) {
        this.relId = relId;
    }
}
